home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / f90 / count.z / count
Encoding:
Text File  |  1998-10-30  |  3.7 KB  |  101 lines

  1. COUNT(3I)                                              Last changed: 1-6-98
  2.  
  3.  
  4. NNAAMMEE
  5.      CCOOUUNNTT - Counts the number of true array elements
  6.  
  7. SSYYNNOOPPSSIISS
  8.      CCOOUUNNTT (([MMAASSKK==]_m_a_s_k [,,[DDIIMM==]_d_i_m]))
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      UNICOS, UNICOS/mk, and IRIX systems
  12.  
  13. SSTTAANNDDAARRDDSS
  14.      Fortran 90
  15.  
  16. DDEESSCCRRIIPPTTIIOONN
  17.      The CCOOUUNNTT intrinsic function counts the number of true array elements
  18.      of argument _m_a_s_k along dimension _d_i_m.  It accepts the following
  19.      arguments:
  20.  
  21.      _m_a_s_k      Must be of type logical.  It must not be a scalar.
  22.  
  23.      _d_i_m       Must be a scalar.  It is an integer with a value in the
  24.                range 1 <= _d_i_m <= _n, where _n is the rank of _m_a_s_k.  The
  25.                corresponding actual argument must not be an optional dummy
  26.                argument.  This function does a check on _d_i_m when present.
  27.  
  28.      CCOOUUNNTT is a transformational function.  The name of this intrinsic
  29.      cannot be passed as an argument.
  30.  
  31. RREETTUURRNN VVAALLUUEESS
  32.      The result is type integer.  It is a scalar result if _d_i_m is absent or
  33.      if _m_a_s_k has rank 1.  Otherwise, the result is an array of rank _n-1 and
  34.      of
  35.      shape (_d , _d , ..., _d     , _d     , ..., _d ),
  36.              1   2        _d_i_m-1   _d_i_m+1        _n
  37.      where (_d , _d , ..., _d )
  38.              1   2        _n
  39.      is the shape of _m_a_s_k.
  40.  
  41.      The result of CCOOUUNNTT((_m_a_s_k)) has a value equal to the number of TTRRUUEE
  42.      elements of _m_a_s_k or has the value 0 if _m_a_s_k is a zero-sized array.
  43.  
  44.      If _m_a_s_k has rank 1, CCOOUUNNTT((_m_a_s_k,, _d_i_m)) has a value equal to that of
  45.      CCOOUUNNTT((_m_a_s_k)).  Otherwise, the value of
  46.  
  47.      element (_s , _s , ..., _s     , _s     , ..., _s )
  48.                1   2        _d_i_m-1   _d_i_m+1        _n
  49.      of CCOOUUNNTT((_m_a_s_k,, _d_i_m)) is equal to
  50.      CCOOUUNNTT((MMAASSKK (_s , _s , ..., _s     , : , _s     , ..., _s )).
  51.                   1   2        _d_i_m-1       _d_i_m+1        _n
  52.  
  53. EEXXAAMMPPLLEESS
  54.      Example 1:
  55.  
  56.      * CCOOUUNNTT(( ((// ..TTRRUUEE..,, ..FFAALLSSEE..,, ..TTRRUUEE.. //)) )) is 2.
  57.  
  58.      * CCOOUUNNTT((_m_a_s_k)) returns zero when _m_a_s_k is a zero-sized array.
  59.  
  60.      Example 2:  Assume that BB is the following array:
  61.  
  62.         | 1 3 5 |
  63.  
  64.         | 2 4 6 |
  65.  
  66.      CC is the following array:
  67.  
  68.         | 0 3 5 |
  69.  
  70.         | 7 4 8 |
  71.  
  72.      * CCOOUUNNTT(( BB ..NNEE.. CC)) is 33
  73.  
  74.      * CCOOUUNNTT(( BB ..NNEE.. CC,, DDIIMM==11)) is [[22,, 00,, 11]]
  75.  
  76.      * CCOOUUNNTT(( BB ..NNEE.. CC,, DDIIMM==22)) is [[11,, 22]]
  77.  
  78.      * CCOOUUNNTT(( CC ..EEQQ.. 11)) returns zero because there are no true elements in
  79.        the mask.
  80.  
  81.      Example 3:  Assume that array NN is as follows:
  82.  
  83.         | 0 1 2 3 |
  84.  
  85.         | 4 5 6 7 |
  86.  
  87.         | 8 9 0 1 |
  88.  
  89.      In an array section reference, you can expect the following results:
  90.  
  91.      * CCOOUUNNTT((((NN((22::33,,22::44))..NNEE..00)))) is 55
  92.  
  93.      * CCOOUUNNTT((((NN((22::33,,22::44))..NNEE..00)),,DDIIMM==11)) is [[22,, 11,, 22]]
  94.  
  95.      * CCOOUUNNTT((((NN((22::33,,22::44))..NNEE..00)),,DDIIMM==22)) is [[33,, 22]]
  96.  
  97. SSEEEE AALLSSOO
  98.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
  99.      printed version of this man page.
  100.  
  101.